<%
/**
 *  list 字典代码列表
 * 
 * @author   李荣华
 * @version  v1.0
 * @date     2017-11-20
 * @since    JSP 2.3.1
 */
%>
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib prefix="at" uri="http://www.jketing.com/at"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>字典代码列表</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta content="no-cache" http-equiv="Pragma"/>
		<meta content="no-cache" http-equiv="Cache-Control"/>
		<meta content="0" http-equiv="Expires"/>
		<meta name="GENERATOR" content="MSHTML 8.00.6001.18854"/>
		<link rel="stylesheet" id="list" type="text/css" href="<at:url css="list.css"/>" />
		<link rel="stylesheet" type="text/css" id="banner" href="<at:url css="banner_button.css"/>" />
		<script type="text/javascript" src="${pageContext.request.contextPath}/scripts/jquery.js"></script>
		<script type="text/javascript" src="${pageContext.request.contextPath}/scripts/common.js"></script>
		<script type="text/javascript" src="<at:url js="list.js"/>"></script>	
		<script type="text/javascript" src="<at:url js="banner_button.js"/>"></script>
		<script type="text/javascript">
			/**
			 * 跳转到添加页面
			 */
			function add(){
				var url = "${pageContext.request.contextPath }/dictionary";
				setTimeout(function(){
				    window.location.href = url;
				},0);	
			}
			
			/**
			 * 点击进入编辑页面
			 */
			function enter(id) {
				var url = "${pageContext.request.contextPath}/dictionary/" + id;
				if (id) {
					if (id != '1') {
						alert(url);
						$("#_form").attr("action", url);
						$("#_form").submit();
					} else {
						alert('不能修改根节点！');
					}
				}
			}

			/**
			 * 选择进入编辑页面
			 */
			function edit() {
				var id = checkOneValue('checkOne');
				var url = "${pageContext.request.contextPath}/dictionary/" + id;
				if (id) {
					if (id != '1') {
						alert(url);
						$("#_form").attr("action", url);
						$("#_form").submit();
					} else {
						alert('不能修改根节点！');
					}
				}
			}
			
			/**
			 * 删除操作
			 */
			function del() {
				var id = checkManyValue('checkOne');
				if (id && window.confirm("你确定要删除吗？")) {
					var url = "${pageContext.request.contextPath }/dictionary/" + ids;
					$("#_form").attr("action", url);
					$("#_method").val("DELETE");
					$("#_form").submit();
				}
			}
			
			/**
			 * 数据列表上的查询按钮调用
			 * 
			 * @return
			 */
			function queryBar() {	
				var bar = document.getElementById("query_bar");
				var header = document.getElementById("dataheader");
				var list = document.getElementById("dataList");
				if (bar.style.display == "none") {
					bar.style.display = "block";
					bar.style.top="52px";
					bar.style.height="30px";
					header.style.top="82px";
					list.style.top="106px";
				} else {
					bar.style.display = "none";				
					bar.style.top="0px";
					bar.style.height="0px";	
					header.style.top="52px";
					list.style.top="76px";
				}	
			}
			
			/**
			 * 页面初始化
			 */
			$(document).ready(function(){
			});				
		</script>
	</head>
	<body>
		<form action="" id="_form" name="queryForm" method="post" >
			<input type="hidden" id="_method" name="_method"/>
			<input type="hidden" name="page" value="${page}" /> 
			<input type="hidden" name="order" value="${order}" /> 
			<input type="hidden" name="vQuery" value="${vQuery}" />
			<!-- 位置 -->
			<div style="margin-left: 10px;margin-top: 10px">当前位置：<a href="#">系统配置</a>-&gt;<font color="#ff0000">系统字典</font></div>		 			
			<!-- 表头 -->
			<div class="list1">
				<!-- 按钮行表单 -->
   				<table width="100%" border="0" cellspacing="0" cellpadding="0">
      				<tr>
						<td width="5" height="24" id="kjz03"></td>
		    			<td class="biao1_zhong">
			            	<table width="100%" border="0" cellspacing="0" cellpadding="0">
			              		<tr>
			               			<td height="24">
				                		<jsp:include page="../../ListHead.jsp" flush="true">
			                				<jsp:param name="delUrl" value="${pageContext.request.contextPath }/dictionary/" />
			                			</jsp:include> 
									</td>
			              		</tr>
			            	</table>
		    			</td>
			    		<td width="5" height="24" id="kjy03"></td>
      				</tr>
    			</table>  		
			</div>
			<!-- 查询条件（默认不显示） -->
			<div id="query_bar" style="display:${vQuery==0?'none':''};" class="queryTab">
				<div>上级编码:
					<select class="picklist" name="parent.id">
						<option value="">
							所有
						</option>
						<c:forEach items="${list}" var="item">
							<option value="${item.id}" ${item.id==query.parent.id?'selected':''}>${item.name}</option>
						</c:forEach>
					</select>
				</div>
				<div>编码名称:<input type="text" name="name" value="${query.name}" /></div>
				<div>英文名称:<input type="text" name="enName" value="${query.enName}" /></div>
				<div>
					<ul>
						<li class="biao5_zhong">
							<a href="#" onclick="document.forms['queryForm'].page.value=1;document.queryForm.submit();">提交</a>
						</li>
					</ul>
				</div>
			</div> 
			<div class="line_left"></div>
			<!-- 标题 -->
			<div id="dataheader" class="list2">
				<table width="100%" border="0" cellspacing="0" cellpadding="0">
		              <tr class="cur">
		                <td width="3%" align="center"><input type='checkbox' onclick="selectReverse('checkOne')" id="ID" value=''/></td>
		                <td width="17%" align="left" style="cursor: pointer" onclick="orderby('name')">编码名称</td>
		                <td width="25%" align="left" style="cursor: pointer" onclick="orderby('enName')">英文名称</td>
		                <td width="25%" align="left" style="cursor: pointer" onclick="orderby('typeCode')">编码类别</td>
		                <td width="15%" align="left" style="cursor: pointer" onclick="orderby('parent.name')">上级编码</td>
		                <td width="15%" align="left" style="cursor: pointer" onclick="orderby('orderNumber')">排序号</td>									                                
	              	</tr>
		        </table>
			</div>
			<!-- 内容 -->
			<div id="dataList" class="list3">
				<c:forEach items="${pageBean.content}" var="item" varStatus="status">
					<table  width="100%" border="0" cellspacing="0" cellpadding="0">
       					<tr id="tr${status.count}" onclick="rowclick(this)">																	
							<td>
								<table width="100%" border="0" cellspacing="0" cellpadding="0">
             					    <tr>
										<td width="3%" height="23" align="center">
										<input id="checkOne" name="checkOne" value="${item.id}" 
										type='checkbox' onclick="dataPageCheckChange(this)"/>
										</td>
										<td width="17%" align="left">
										<a href="#" onclick="enter('${item.id}');">${item.name}</a>
										</td>
										<td width="25%" align="left">${item.enName}</td>
										<td width="25%" align="left">${item.typeName}</td>
										<td width="15%" align="left">${item.parent.name}</td>
										<td width="15%" align="left">${item.orderNumber}</td>																		
									</tr>
					            </table>
					         </td>												        
					    </tr>
					</table>
				</c:forEach>
	    	</div>
	    	<div class="line_rigth"></div>
			<div class="list4">
			<!-- 页码 -->
		      	<table width="100%" border="0" cellspacing="0" cellpadding="0">
			          <tr valign="top">
			            <td width="4" height="24" id="kj2z03"></td>
			             <td class="biao4_zhong">
				            <table width="100%" border="0" cellspacing="0" cellpadding="0">
				              <tr>									                
				                <td>
					                <table align="right">
					                  <tr>										                  
					                  	<at:page />										                  									                     
					                  </tr>
					                </table>
				                </td>									                
				              </tr>
				            </table>
			            </td>
			            <td width="4" height="24" id="kj2y03"></td>
			        </tr>
	        	</table>
			</div>
		</form>
	</body>
</html>
